//
//  LSRThemeVoiceView.m
//  BaiSiProject
//
//  Created by lshenrong on 16/7/14.
//  Copyright © 2016年 lshenrong. All rights reserved.
//

#import "LSRThemeVoiceView.h"
#import "LSRThemeItem.h"
#import <UIImageView+WebCache.h>
@class LSRThemeVoiceView;
@interface LSRThemeVoiceView ();
@property (weak, nonatomic) IBOutlet UIImageView *voiceImageView;
@property (weak, nonatomic) IBOutlet UILabel *countView;
@property (weak, nonatomic) IBOutlet UILabel *timeView;


@end
@implementation LSRThemeVoiceView


+(instancetype)themeVoiceView
{
    
    return [[[NSBundle mainBundle] loadNibNamed:NSStringFromClass(self)    owner:nil options:nil] lastObject];
 }
-(void)setItem:(LSRThemeItem *)item
{
    _item=item;
    [self.voiceImageView sd_setImageWithURL:[NSURL URLWithString:item.image0]];
    self.countView.text=item.playcount;
    
    NSInteger hour=item.voicetime/60;
    NSInteger minute=item.voicetime%60;
    
    NSString *timestring=[NSString stringWithFormat:@"%02ld:%02ld",(long)hour,minute];
    self.timeView.text=timestring;

}
@end
